package com.stream;

import java.util.List;

public class StreamDemo01 {
    public static void main(String[] args) {
//l  定义集合List<String>，添加以下数据
// ​     “王思聪”  刘晓敏”  “张三丰”   “张靓颖”  “张飞”
        List<String> list = List.of("王思聪","刘晓敏","张三丰","张靓颖","张飞");

// 使用Stream流的forEach()方法打印集合的所有元素
        list.stream().forEach(s -> System.out.println(s));
    }
}
